# 主要用于测试csv数据的导入及数据库等相关功能

from vnpy.event import EventEngine 
from vnpy.trader.engine import MainEngine
from vnpy.app.data_manager.engine import ManagerEngine
from vnpy.trader.constant import Exchange, Interval

event_engine = EventEngine()
main_engine = MainEngine(event_engine)

manager_engine = ManagerEngine(main_engine, event_engine)
# 用于测试open函数的路径
# import os 
# print(os.getcwd())
manager_engine.import_data_from_csv(
    file_path="./desktop/vnpy_backtesting/vnpy/data/eurusd.csv", 
    symbol="test", 
    exchange=Exchange.LOCAL, 
    interval=Interval.DAILY,
    datetime_head='datetime', 
    open_head='open', 
    high_head='high', 
    low_head='low', 
    close_head='close', 
    volume_head='volume', 
    open_interest_head='', 
    datetime_format="%Y%m%d"
    )

print("import is done!")

main_engine.close()

